package Data;

public class Vip extends Record{
//	enum Sex{MALE,FEMALE};
	private String name;
	private String birthDate;
	private String sex;
	private long mobliephone;
	private int restScores;
	private int totalScores;
	private int shopNumber;
	
	public Vip(){
		
	}
	public Vip(int ID,String name,String birthDate,String sex,long mobliephone,int restScores,int totalScores,int shopNumber){
		this.ID=ID;
		this.name=name;
		this.birthDate=birthDate;
		this.sex=sex;
		this.mobliephone=mobliephone;
		this.restScores=restScores;
		this.totalScores=totalScores;
		this.shopNumber = shopNumber;
		
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getBirthDate() {
		return birthDate;
	}
	public void setBirthDate(String birthDate) {
		this.birthDate = birthDate;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public long getMobliephone() {
		return mobliephone;
	}
	public void setMobliephone(long mobliephone) {
		this.mobliephone = mobliephone;
	}
	public int getRestScores() {
		return restScores;
	}
//	public void setRestScores(int restScores) {
//		this.restScores = restScores;
//	}
	private void addRestScores(int count){
		this.restScores+=count;
	}
	public int getTotalScores() {
		return totalScores;
	}
	private void addTotalScores(int count){
		this.totalScores+=count;
	}
	public void addScores(int count){
		addTotalScores(count);
		addRestScores(count);
	}
//	public void setTotalScores(int totalScores) {
//		this.totalScores = totalScores;
//	}
	@Override
	public String toString() {
		return ID+","+name+","+birthDate+","+sex+","+mobliephone+","+restScores+","+totalScores+","+shopNumber;
	}
	public static Record toObject(String vipData){
		String[] temp = vipData.split(",");
		Vip one = new Vip(Integer.parseInt(temp[0]), temp[1], temp[2], temp[3], Long.parseLong(temp[4]), Integer.parseInt(temp[5]), Integer.parseInt(temp[6]),Integer.parseInt(temp[7]));
		return one;
	}
	public int getShopNumber() {
		return shopNumber;
	}
	public void setShopNumber(int shopNumber) {
		this.shopNumber = shopNumber;
	}

	
	
	

}
